package com.yiyuan.app.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import com.yiyuan.app.entity.po.MRecordNoticePO;
import com.yiyuan.app.mapper.MRecordNoticeMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class MRecordNoticeDAO extends BaseDAO<MRecordNoticeMapper, MRecordNoticePO> {

    public List<MRecordNoticePO> findNoticeList(){
        LambdaQueryWrapper<MRecordNoticePO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(MRecordNoticePO::getCreateTime);
        queryWrapper.last("limit 0,10");
        return getBaseMapper().selectList(queryWrapper);
    }
}
